package com.cqjtu.eecs.service.impl;

import com.cqjtu.eecs.entity.GraduateRequirementTemplate;
import com.cqjtu.eecs.entity.vo.GraduateRequirementDetailVo;
import com.cqjtu.eecs.mapper.GraduateRequirementTemplateMapper;
import com.cqjtu.eecs.service.IGraduateRequirementTemplateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 毕业要求模板 服务实现类
 * </p>
 *
 * @author   
 * @since 2022-02-28
 */
@Service
public class GraduateRequirementTemplateServiceImpl extends ServiceImpl<GraduateRequirementTemplateMapper, GraduateRequirementTemplate> implements IGraduateRequirementTemplateService {

    @Autowired
    private GraduateRequirementTemplateMapper graduateRequirementMapper;

    /**
     * 根据专业代码和版本编号查询毕业要求
     * @param majorCode
     * @param versionCode
     * @return
     */
    @Override
    public List<GraduateRequirementDetailVo> getGraduateRequirementDetailByMajorCodeAndVersionCode(String majorCode, String versionCode) {
        try {
            List<GraduateRequirementDetailVo> graduateRequirementDetailVoList = graduateRequirementMapper.getGraduateRequirementDetailByMajorCodeAndVersionCode(majorCode, versionCode);
            return graduateRequirementDetailVoList;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
